%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% plotting Figure 1 for the paper - from production function
% decomposition
% this version: October 2013
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

irfs_pfd_rev; % input
HORIZON = 10;
tt = (0:HORIZON);
zerobar = zeros(1,HORIZON);


figure(1);
subplot(1,3,1); plot(tt,[0,zerobar],'-k',tt,[nan,irfs(1:HORIZON,3)'],'-k',tt,[nan,irfs(1:HORIZON,5)'],'--r',tt,[nan,irfs(1:HORIZON,6)'],'--r')
axis([0 10 -0.6 0.7]);
ylabel('Prod. fnc. res.');
title('premium');
subplot(1,3,2); plot(tt,[0,zerobar],'-k',tt,[nan,irfs(1:HORIZON,11)'],'-k',tt,[nan,irfs(1:HORIZON,13)'],'--r',tt,[nan,irfs(1:HORIZON,14)'],'--r')
axis([0 10 -0.6 0.7]);
title('productivity');
subplot(1,3,3); plot(tt,[0,zerobar],'-k',tt,[nan,irfs(1:HORIZON,19)'],'-k',tt,[nan,irfs(1:HORIZON,21)'],'--r',tt,[nan,irfs(1:HORIZON,22)'],'--r')
axis([0 10 -0.6 0.7]);
title('hours');
set(gcf,'paperunits','centimeters','PaperPosition',[0 0 13 4])
print('-depsc2','solow_irfs_6lags_res.eps')

figure(2);
subplot(1,3,1); plot(tt,[0,zerobar],'-k',tt,[nan,irfs(1:HORIZON,3)'],':k',tt,[nan,irfs(1:HORIZON,7)'],'-k',tt,[nan,irfs(1:HORIZON,9)'],'--r',tt,[nan,irfs(1:HORIZON,10)'],'--r')
axis([0 10 -0.6 0.7]);
ylabel('SBT+UBT shock');
subplot(1,3,2); plot(tt,[0,zerobar],'-k',tt,[nan,irfs(1:HORIZON,11)'],':k',tt,[nan,irfs(1:HORIZON,15)'],'-k',tt,[nan,irfs(1:HORIZON,17)'],'--r',tt,[nan,irfs(1:HORIZON,18)'],'--r')
axis([0 10 -0.6 0.7]);
subplot(1,3,3); plot(tt,[0,zerobar],'-k',tt,[nan,irfs(1:HORIZON,19)'],':k',tt,[nan,irfs(1:HORIZON,23)'],'-k',tt,[nan,irfs(1:HORIZON,25)'],'--r',tt,[nan,irfs(1:HORIZON,26)'],'--r')
axis([0 10 -0.6 0.7]);
set(gcf,'paperunits','centimeters','PaperPosition',[0 0 13 4])
print('-depsc2','solow_irfs_6lags_SVAR.eps')

